package com.vt.common.security.service;

import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 扩展用户信息
 */
public class CustomUser extends User {
    /**
     * 用户ID
     */
    @Getter
    private String id;

    /**
     * 用户姓名
     */
    @Getter
    private String name;

    @Getter
    @Setter
    private Integer userType;

    public CustomUser(String id, String name, String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.id = id;
        this.name = name;
    }
}
